﻿using System;
using System.Web;
using Castle.Windsor;
using EventApp.Lib.Domain;
using EventApp.Lib.Helper;
using EventApp.Lib.Repository;

namespace EventApp.Web
{
    public class Global : HttpApplication
    {
        private WindsorContainer container;

        public WindsorContainer Container
        {
            get { return container; }
            set { container = value; }
        }


        protected void Application_Start(object sender, EventArgs e)
        {
            Container = new WindsorContainer();
            Container.AddComponent("sessionBuilder", typeof(ISessionBuilder), typeof(SessionBuilder));
            Container.AddComponent("dataRepository", typeof(IDataRepository<Event>), typeof(DataRepository<Event>));
            Container.AddComponent("eventRepository", typeof(SessionBuilder));
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}